package wonders.mapper;

import org.apache.ibatis.annotations.*;
import wonders.pojo.Person;

import java.util.List;

//@Mapper
public interface PersonMapper {
    @Insert("insert into person(name) values (#{p.name});")
    void insert(@Param("p") Person p);

    @Select("select * from person p where p.id = #{id};")
    Person selectById(@Param("id") int id);

    @Select("select * from person;")
    List<Person> selectAll();

    @Delete("delete from person where id = #{id};")
    void delete(@Param("id") int id);
}
